﻿@model CodeStash.Models.Snippet.ReadOnlyDisplaySnippetsViewModel
@{
	ViewBag.Title = "Snippets";
	Layout = "~/Views/Shared/_ReadonlyLayout.cshtml";
}
@using CodeStash.ExtensionsMethods


@section SpecificPageHeadStuff
 {
     @Html.CssTag(Url.Content("~/Content/Controllers/DisplaySnippets/displaySnippets.css"))
     @Html.ScriptTag(Url.Content("~/Scripts/Controllers/Readonly/displaySnippets.js"))
}


<div id="dialog-message"  style="display:none;">
	<p id="dialog-message-content">
	</p>
</div>

<div id="DisplaySnippetPanel">
    
    <h2>Code Snippets</h2>
    <input id="HighlightingCSSToUse" type="hidden" value="@Model.HighlightingCSS" />
 
    <div>

        <p id="noSnippetsMessage" style="display:none;">There are no CodeSnippets to display</p>
    

        @if (Model.IsTruncated)
        {
            <br />
            <div class="errorMessage">
            <img style="margin:10px;" src="../../Content/images/error.png" height="50px" alt="" />
            <div style="position: absolute; display:inline-block; line-height:30px; height:30px;color:White">
                <p>
                    <span>
                    <strong>
                    NOTE : 
                    </strong>
                    The current snippet query has exceeded the maximum allowable limit of displayable snippets
                    </span>
                    <br />
            
                    You should login and conduct a search for more accurate results
            
                </p>
            </div>
            </div>
            <br />
            <br />
    
        }


        @if (Model.IsGrouped)
        {
            <p id="snippetsMessage">As the requested snippet is part of a group, displaying all Code Snippets in Group 
            [@Model.CodeSnippets.First().Grouping.Description]</p>
        }
        else
        {
            <p id="snippetsMessage">The requested snippet is shown below</p>
        }
    
        @foreach (CodeStash.Common.DataAccess.EntityFramework.CodeSnippet snippet in Model.CodeSnippets)
        {
            @Html.Partial("ReadonlySingleSnippetPartial", snippet);
        }
    
    
    </div>

    


</div>


